package com.nbsaas.boot.product.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "商品规格值", model = "商品规格值")
@Entity
@Table(name = "bs_product_specification_value")
@Comment("商品规格值表")
public class ProductSpecificationValue extends AbstractEntity {

    @Comment("商品ID")
    @FormField(title = "商品ID", sortNum = "1", grid = true, required = true)
    private Long productId;

    @Comment("规格ID")
    @FormField(title = "规格ID", sortNum = "2", grid = true, required = true)
    private Long specificationId;

    @Comment("规格值")
    @SearchItem(name = "value", key = "value", label = "规格值")
    @FormField(title = "规格值", sortNum = "3", grid = true, required = true)
    @Column(length = 200, nullable = false)
    private String value;

    @Comment("规格值编码")
    @SearchItem(name = "code", key = "code", label = "规格值编码")
    @FormField(title = "规格值编码", sortNum = "4", grid = true)
    @Column(length = 50)
    private String code;

    @Comment("规格值图片")
    @FormField(title = "规格值图片", sortNum = "5", type = InputType.image)
    @Column(length = 500)
    private String image;

    @Comment("规格值颜色")
    @FormField(title = "规格值颜色", sortNum = "6", grid = true)
    @Column(length = 20)
    private String color;

    @Comment("规格值描述")
    @FormField(title = "规格值描述", sortNum = "7", grid = true)
    @Column(length = 500)
    private String description;

    @Comment("排序")
    @FormField(title = "排序", sortNum = "8", grid = true, type = InputType.el_input_number, sort = true)
    private Integer sort;

    @Comment("是否启用")
    @FormField(title = "是否启用", sortNum = "9", grid = true, type = InputType.select)
    private Boolean enabled;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "10", type = InputType.richText, col = 23)
    @Column(length = 1000)
    private String note;
} 